const state = {
  isShowLoading: false,
  requestCount: 0,
  responseErrorStatus: false,
};

const getters = {
  getRequestCount: (state) => state.requestCount,
};

const mutations = {
  countRequest(state) {
    state.isShowLoading = true;
    state.requestCount++;
  },
  countResponse(state) {
    state.isShowLoading = false;
    state.requestCount--;
  },
  responseError(state) {
    state.responseErrorStatus = true;
  },
};

const actions = {
  testTest({
    dispatch, commit, getters, rootGetters,
  }) {
    console.log(rootGetters.myTestGetters);
    console.log('in request action');
    // commit('', null, { root: true })
  },
};

export default {
  state,
  getters,
  mutations,
  actions,
};
